local app = require 'app'
local game = require "club.threecard.scibo"

local rule = game.ui.element()

function rule:ctor()
    self.res = "club.threecard.scibo/ui/ingame.b:rule"

    self.title = app.i18n.text("scibo:rule_title")
    self.content = app.i18n.text("scibo:rule")
end

function rule:on_injected(bind)
    bind("button.click", self.close_mask, self.hide);
    self.close_mask.gameObject:SetActive(false);

    self.title_txt.text = self.title;
    self.content_txt.text = self.content;
end

function rule:show()
    self.animator:Play("rule_show_clip");
    self.close_mask.gameObject:SetActive(true);
    self.visible = true;
end

function rule:hide()
    self.animator:Play("rule_hide_clip");
    self.close_mask.gameObject:SetActive(false);
    self.visible = false;
end

return rule